package com.mybatis.plugin;

public class Page {

    public Page(int size, int index) {
        this.size = size;
        this.index = index;
    }

    private int total;

    private int size;

    private int index;

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    /**
     * 从0开始
     * @return offset
     */
    public int getOffset() {
        return size * (index - 1);
    }
}
